<!DOCTYPE html>

<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

<title>class RsqvpreviewController - Rails Application Documentation</title>

<link type="text/css" media="screen" href="./rdoc.css" rel="stylesheet">

<script type="text/javascript">
  var rdoc_rel_prefix = "./";
</script>

<script type="text/javascript" charset="utf-8" src="./js/jquery.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/navigation.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search_index.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/search.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/searcher.js"></script>
<script type="text/javascript" charset="utf-8" src="./js/darkfish.js"></script>


<body id="top" class="class">
<nav id="metadata">
  <nav id="home-section" class="section">
  <h3 class="section-header">
    <a href="./index.html">Home</a>
    <a href="./table_of_contents.html#classes">Classes</a>
    <a href="./table_of_contents.html#methods">Methods</a>
  </h3>
</nav>


  <nav id="search-section" class="section project-section" class="initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <h3 class="section-header">
      <input type="text" name="search" placeholder="Search" id="search-field"
             title="Type to search, Up and Down to navigate, Enter to load">
    </h3>
  </form>

  <ul id="search-results" class="initially-hidden"></ul>
</nav>


  <div id="file-metadata">
    <nav id="file-list-section" class="section">
  <h3 class="section-header">Defined In</h3>
  <ul>
    <li>app/controllers/rsqvpreview_controller.rb
  </ul>
</nav>

    
  </div>

  <div id="class-metadata">
    
    <nav id="parent-class-section" class="section">
  <h3 class="section-header">Parent</h3>
  
  <p class="link"><a href="ApplicationController.html">ApplicationController</a>
  
</nav>

    
    <!-- Method Quickref -->
<nav id="method-list-section" class="section">
  <h3 class="section-header">Methods</h3>

  <ul class="link-list">
    
    <li><a href="#method-i-convert">#convert</a>
    
    <li><a href="#method-i-insert_controlfield">#insert_controlfield</a>
    
    <li><a href="#method-i-insert_datafield">#insert_datafield</a>
    
    <li><a href="#method-i-insert_subfield">#insert_subfield</a>
    
  </ul>
</nav>

  </div>

  <div id="project-metadata">
    <nav id="fileindex-section" class="section project-section">
  <h3 class="section-header">Pages</h3>

  <ul>
  
    <li class="file"><a href="./doc/README_FOR_APP.html">README_FOR_APP</a>
  
  </ul>
</nav>

    <nav id="classindex-section" class="section project-section">
  <h3 class="section-header">Class and Module Index</h3>

  <ul class="link-list">
  
    <li><a href="./MarcTools.html">MarcTools</a>
  
    <li><a href="./MarcTools/MarcConverter.html">MarcTools::MarcConverter</a>
  
    <li><a href="./ApplicationController.html">ApplicationController</a>
  
    <li><a href="./ApplicationHelper.html">ApplicationHelper</a>
  
    <li><a href="./CzController.html">CzController</a>
  
    <li><a href="./MarcconverterController.html">MarcconverterController</a>
  
    <li><a href="./Object.html">Object</a>
  
    <li><a href="./OracleController.html">OracleController</a>
  
    <li><a href="./PersonController.html">PersonController</a>
  
    <li><a href="./PersonHelper.html">PersonHelper</a>
  
    <li><a href="./RsqvHelper.html">RsqvHelper</a>
  
    <li><a href="./RsqvpreviewController.html">RsqvpreviewController</a>
  
  </ul>
</nav>

  </div>
</nav>

<div id="documentation">
  <h1 class="class">class RsqvpreviewController</h1>

  <div id="description" class="description">
    
  </div><!-- description -->

  
  
  
  <section id="5Buntitled-5D" class="documentation-section">
    

    

    

    

    <!-- Methods -->
    
     <section id="public-instance-5Buntitled-5D-method-details" class="method-section section">
      <h3 class="section-header">Public Instance Methods</h3>

    
      <div id="method-i-convert" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">convert</span><span
            class="method-args">()</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="convert-source">
            <pre><span class="ruby-comment"># File app/controllers/rsqvpreview_controller.rb, line 26</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">convert</span>
  
  <span class="ruby-identifier">rismid</span>=<span class="ruby-string">&quot;458002040&quot;</span>
       
  <span class="ruby-identifier">dn</span> =<span class="ruby-string">'dn:http://www.loc.gov/MARC21/slim'</span>
  <span class="ruby-identifier">xml_document</span> = <span class="ruby-constant">LibXML</span><span class="ruby-operator">::</span><span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">file</span>(<span class="ruby-string">'/home/stephan/RSQV/cz.xml'</span>)
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">params</span>[<span class="ruby-value">:extext</span>]
    <span class="ruby-identifier">rismid</span>=<span class="ruby-identifier">params</span>[<span class="ruby-value">:extext</span>]
  <span class="ruby-keyword">end</span>
  <span class="ruby-identifier">book_xpath</span> = <span class="ruby-string">'//dn:record/dn:controlfield[@tag=&quot;001&quot;][contains(.,&quot;'</span><span class="ruby-operator">+</span><span class="ruby-identifier">rismid</span><span class="ruby-operator">+</span><span class="ruby-string">'&quot;)]/..'</span>
  <span class="ruby-identifier">nodes</span>=<span class="ruby-identifier">xml_document</span>.<span class="ruby-identifier">find</span>(<span class="ruby-identifier">book_xpath</span>,<span class="ruby-identifier">dn</span>)
  <span class="ruby-ivar">@ids</span>=<span class="ruby-identifier">xml_document</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'//dn:record/dn:controlfield[@tag=&quot;001&quot;]/text()'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">to_a</span>.<span class="ruby-identifier">shuffle</span>[<span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">6</span>]
  <span class="ruby-ivar">@archive_node</span>=<span class="ruby-constant">Array</span>.<span class="ruby-identifier">new</span>
  <span class="ruby-identifier">nodes</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>  <span class="ruby-ivar">@archive_node</span>.<span class="ruby-identifier">push</span>(<span class="ruby-identifier">e</span>.<span class="ruby-identifier">copy</span>(<span class="ruby-value">:deep</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-keyword">false</span>))}
 
  <span class="ruby-identifier">doc</span> = <span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Document</span>.<span class="ruby-identifier">new</span>()
  <span class="ruby-ivar">@doc1</span>=<span class="ruby-identifier">doc</span>
  <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span> = <span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;collection&quot;</span>)
 
  <span class="ruby-comment">#XML::Namespace.new(doc.root, nil, 'http://www.loc.gov/MARC21/slim')</span>
 
  <span class="ruby-keyword">if</span> <span class="ruby-identifier">nodes</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">&gt;=</span> <span class="ruby-value">1</span>
    <span class="ruby-identifier">nodes</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">item</span><span class="ruby-operator">|</span>
      <span class="ruby-identifier">doc</span>.<span class="ruby-identifier">root</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">record</span>=<span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;record&quot;</span>)
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:leader'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">record</span><span class="ruby-operator">&lt;&lt;</span><span class="ruby-identifier">leader</span>=<span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;leader&quot;</span>) ;  <span class="ruby-identifier">leader</span>.<span class="ruby-identifier">content</span>=<span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span> }
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:controlfield[@tag=&quot;001&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>  <span class="ruby-identifier">insert_controlfield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'001'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>)}
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:controlfield[@tag=&quot;003&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>  <span class="ruby-identifier">insert_controlfield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'003'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>)}
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:controlfield[@tag=&quot;005&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>  <span class="ruby-identifier">insert_controlfield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'005'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>)}
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:controlfield[@tag=&quot;008&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>  <span class="ruby-identifier">insert_controlfield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'008'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>)}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;035&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'035'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;040&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'040'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;041&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'041'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;100&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'100'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;d&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'d'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;0&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'0'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;240&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'240'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
          <span class="ruby-comment">#Splitting title before &lt;br&gt;</span>
          <span class="ruby-identifier">term</span>=<span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>
          <span class="ruby-identifier">stopchar</span> = <span class="ruby-string">'&lt;br&gt;'</span>
          <span class="ruby-identifier">term</span>=<span class="ruby-identifier">term</span>.<span class="ruby-identifier">sub</span> <span class="ruby-node">/#{stopchar}.+/</span>, <span class="ruby-string">''</span>
          <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">term</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;m&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span>
          <span class="ruby-identifier">count</span>=<span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>.<span class="ruby-identifier">count</span>(<span class="ruby-string">'-'</span>)
          <span class="ruby-comment">#Raw method for replacing many instruments</span>
          <span class="ruby-keyword">if</span> <span class="ruby-identifier">count</span><span class="ruby-operator">&gt;=</span><span class="ruby-value">5</span>
            <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'m'</span>, <span class="ruby-string">'V(X), orch'</span>)
          <span class="ruby-keyword">else</span>
            <span class="ruby-identifier">term</span>=<span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>
            <span class="ruby-identifier">term</span>=<span class="ruby-identifier">term</span>.<span class="ruby-identifier">gsub</span> <span class="ruby-regexp">/Klv\./</span>,<span class="ruby-string">'pf'</span>
            <span class="ruby-identifier">term</span>=<span class="ruby-identifier">term</span>.<span class="ruby-identifier">gsub</span> <span class="ruby-regexp">/Vl\./</span>,<span class="ruby-string">'vl'</span>
            <span class="ruby-identifier">term</span>=<span class="ruby-identifier">term</span>.<span class="ruby-identifier">gsub</span> <span class="ruby-regexp">/Va\./</span>,<span class="ruby-string">'vla'</span>
            <span class="ruby-identifier">term</span>=<span class="ruby-identifier">term</span>.<span class="ruby-identifier">gsub</span> <span class="ruby-regexp">/Vc\./</span>,<span class="ruby-string">'vlc'</span>
            <span class="ruby-identifier">term</span>=<span class="ruby-identifier">term</span>.<span class="ruby-identifier">gsub</span> <span class="ruby-regexp">/Singst\./</span>, <span class="ruby-string">'V'</span>
            <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'m'</span>, <span class="ruby-identifier">term</span>)
          <span class="ruby-keyword">end</span>
        }
        <span class="ruby-comment">#e.find('dn:subfield[@code=&quot;m&quot;]',dn).each {|e| insert_subfield(df,'m', e.content) }</span>
 
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;n&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'n'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }  }
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;245&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'245'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;260&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'260'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;c&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'c'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;300&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'300'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;c&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'c'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;383&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'383'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;b&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'b'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;510&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'510'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;c&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'c'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;592&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'592'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;593&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'593'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;594&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'594'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;595&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'595'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;700&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'700'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;d&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'d'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;0&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'0'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;4&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'4'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;852&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'852'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;a&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'a'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;c&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'c'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;x&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'x'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
      <span class="ruby-identifier">item</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:datafield[@tag=&quot;856&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {  <span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">df</span>=<span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">record</span>, <span class="ruby-string">'856'</span>)
        <span class="ruby-identifier">e</span>.<span class="ruby-identifier">find</span>(<span class="ruby-string">'dn:subfield[@code=&quot;u&quot;]'</span>,<span class="ruby-identifier">dn</span>).<span class="ruby-identifier">each</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">e</span><span class="ruby-operator">|</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">df</span>,<span class="ruby-string">'u'</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">content</span>) }}
 
    }
  <span class="ruby-keyword">else</span>
    <span class="ruby-ivar">@node</span>=<span class="ruby-string">&quot;No result&quot;</span>
  <span class="ruby-keyword">end</span>
 
<span class="ruby-keyword">end</span></pre>
          </div><!-- convert-source -->
          
        </div>

        

        
      </div><!-- convert-method -->

    
      <div id="method-i-insert_controlfield" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">insert_controlfield</span><span
            class="method-args">(node, tag, term)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="insert_controlfield-source">
            <pre><span class="ruby-comment"># File app/controllers/rsqvpreview_controller.rb, line 19</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert_controlfield</span>(<span class="ruby-identifier">node</span>, <span class="ruby-identifier">tag</span>, <span class="ruby-identifier">term</span>)
  <span class="ruby-identifier">node</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">controlfield</span> = <span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;controlfield&quot;</span>)
  <span class="ruby-identifier">controlfield</span>[<span class="ruby-string">'tag'</span>]=<span class="ruby-identifier">tag</span>
  <span class="ruby-identifier">controlfield</span>.<span class="ruby-identifier">content</span>=<span class="ruby-identifier">term</span>
  <span class="ruby-identifier">controlfield</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- insert_controlfield-source -->
          
        </div>

        

        
      </div><!-- insert_controlfield-method -->

    
      <div id="method-i-insert_datafield" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">insert_datafield</span><span
            class="method-args">(node, tag)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="insert_datafield-source">
            <pre><span class="ruby-comment"># File app/controllers/rsqvpreview_controller.rb, line 4</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert_datafield</span>(<span class="ruby-identifier">node</span>, <span class="ruby-identifier">tag</span>)
   <span class="ruby-identifier">node</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">datafield</span> = <span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;datafield&quot;</span>)
   <span class="ruby-identifier">datafield</span>[<span class="ruby-string">'tag'</span>]=<span class="ruby-identifier">tag</span>
   <span class="ruby-identifier">datafield</span>[<span class="ruby-string">'ind1'</span>]=<span class="ruby-string">&quot; &quot;</span>
   <span class="ruby-identifier">datafield</span>[<span class="ruby-string">'ind2'</span>]=<span class="ruby-string">&quot; &quot;</span>
   <span class="ruby-identifier">datafield</span>
 <span class="ruby-keyword">end</span></pre>
          </div><!-- insert_datafield-source -->
          
        </div>

        

        
      </div><!-- insert_datafield-method -->

    
      <div id="method-i-insert_subfield" class="method-detail ">
        
        <div class="method-heading">
          <span class="method-name">insert_subfield</span><span
            class="method-args">(node, code, term)</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>
        

        <div class="method-description">
          
          
          

          
          <div class="method-source-code" id="insert_subfield-source">
            <pre><span class="ruby-comment"># File app/controllers/rsqvpreview_controller.rb, line 12</span>
<span class="ruby-keyword">def</span> <span class="ruby-identifier">insert_subfield</span>(<span class="ruby-identifier">node</span>, <span class="ruby-identifier">code</span>, <span class="ruby-identifier">term</span>)
  <span class="ruby-identifier">node</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">subfield</span> = <span class="ruby-constant">XML</span><span class="ruby-operator">::</span><span class="ruby-constant">Node</span>.<span class="ruby-identifier">new</span>(<span class="ruby-string">&quot;subfield&quot;</span>)
  <span class="ruby-identifier">subfield</span>[<span class="ruby-string">'code'</span>]=<span class="ruby-identifier">code</span>
  <span class="ruby-identifier">subfield</span>.<span class="ruby-identifier">content</span>=<span class="ruby-identifier">term</span>
  <span class="ruby-identifier">subfield</span>
<span class="ruby-keyword">end</span></pre>
          </div><!-- insert_subfield-source -->
          
        </div>

        

        
      </div><!-- insert_subfield-method -->

    
    </section><!-- public-instance-method-details -->
  
  </section><!-- 5Buntitled-5D -->

</div><!-- documentation -->


<footer id="validator-badges">
  <p><a href="http://validator.w3.org/check/referer">[Validate]</a>
  <p>Generated by <a href="https://github.com/rdoc/rdoc">RDoc</a> 3.12.2.
  <p>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish Rdoc Generator</a> 3.
</footer>

